
-- --------------------------------------------------
-- Entity Designer DDL Script for SQL Server 2005, 2008, and Azure
-- --------------------------------------------------
-- Date Created: 11/29/2012 12:54:12
-- Generated from EDMX file: C:\Users\cmurczek\Documents\Visual Studio 2010\Projects\Agility\Trunk\Source\Agility.Web\Models\DomainModel\RequirementsModel.edmx
-- --------------------------------------------------

SET QUOTED_IDENTIFIER OFF;
GO
USE [Agility];
GO
IF SCHEMA_ID(N'dbo') IS NULL EXECUTE(N'CREATE SCHEMA [dbo]');
GO

-- --------------------------------------------------
-- Dropping existing FOREIGN KEY constraints
-- --------------------------------------------------


-- --------------------------------------------------
-- Dropping existing tables
-- --------------------------------------------------

IF OBJECT_ID(N'[dbo].[EpicAssessments]', 'U') IS NOT NULL
    DROP TABLE [dbo].[EpicAssessments];
GO
IF OBJECT_ID(N'[dbo].[Epics]', 'U') IS NOT NULL
    DROP TABLE [dbo].[Epics];
GO

-- --------------------------------------------------
-- Creating all tables
-- --------------------------------------------------

-- Creating table 'Assessments'
CREATE TABLE [dbo].[Assessments] (
    [Id] uniqueidentifier  NOT NULL,
    [EffortSize] int  NULL,
    [PotentialBusinessValue] int  NULL,
    [StrategyAlignment] decimal(18,0)  NULL,
    [RankingValue] decimal(18,0)  NULL,
    [IsApproved] bit  NULL,
    [CreationDate] datetime  NOT NULL
);
GO

-- Creating table 'Epics'
CREATE TABLE [dbo].[Epics] (
    [Id] uniqueidentifier  NOT NULL,
    [Title] nvarchar(30)  NOT NULL,
    [Description] nvarchar(250)  NOT NULL,
    [CreationDate] datetime  NOT NULL,
    [RequestedBy] nvarchar(max)  NOT NULL
);
GO

-- --------------------------------------------------
-- Creating all PRIMARY KEY constraints
-- --------------------------------------------------

-- Creating primary key on [Id] in table 'Assessments'
ALTER TABLE [dbo].[Assessments]
ADD CONSTRAINT [PK_Assessments]
    PRIMARY KEY CLUSTERED ([Id] ASC);
GO

-- Creating primary key on [Id] in table 'Epics'
ALTER TABLE [dbo].[Epics]
ADD CONSTRAINT [PK_Epics]
    PRIMARY KEY CLUSTERED ([Id] ASC);
GO

-- --------------------------------------------------
-- Creating all FOREIGN KEY constraints
-- --------------------------------------------------

-- --------------------------------------------------
-- Script has ended
-- --------------------------------------------------